package aloyii.demo3.before;

/**
 * @Author yajing zhu
 * @Date 2024/10/25 15:04
 * @Version 1.0
 * @注释：
 */
public class Computer {
    private XiJieHardDisk hardDisk;
    private IntelCpu cpu;
    private KingstonMemory memory;
    
    public XiJieHardDisk getHardDisk() {
        return hardDisk;
    }
    
    public void setHardDisk(XiJieHardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }
    
    public IntelCpu getCpu() {
        return cpu;
    }
    
    public void setCpu(IntelCpu cpu) {
        this.cpu = cpu;
    }
    
    public KingstonMemory getMemory() {
        return memory;
    }
    
    public void setMemory(KingstonMemory memory) {
        this.memory = memory;
    }
    
    public void run() {
        System.out.println("运行计算机！");
        String data = hardDisk.get();
        System.out.println("从硬盘中取出数据：" + data);
        cpu.run();
        memory.save();
    }
}
